import Vue from 'vue'
import Router from 'vue-router'
import Home from '../components/tarbar/Home'
import Vip from '../components/tarbar/Vip'
import Search from '../components/tarbar/Search'
import ShopCar from '../components/tarbar/ShopCar'
import NewsList from '../components/home/NewsList'
import NewsInfo from '../components/home/NewsInfo'
import PhotoList from '../components/home/PhotoList'
import PhotoInfo from '../components/home/PhotoInfo'
import GoodsList from '../components/home/GoodsList'
import GoodsInfo from '../components/home/GoodsInfo'
import GoodsComment from '../components/home/GoodsComment'
import GoodsDesc from '../components/home/GoodsDesc'






Vue.use(Router)

export default new Router({

    routes: [
        //路哟重定向
        { path: '/', redirect: '/home' },
        //配置路由规则
        {
            path: '/home',
            component: Home,
            //这不能使用路由嵌套
            // children:[{path:'newsList',name:'newsList',component:NewsList}]
        },
        {//新闻页
            path: '/home/newsList'
            , component: NewsList
        },
        {//新闻详情页
            path: '/home/newsInfo/:id'
            , component: NewsInfo
        },
        {//图片列表页
            path: '/home/photoList',
            component: PhotoList
        },
         {//图片详情页
            path: '/home/photoInfo/:id',
            component: PhotoInfo
        },
         {//商品列表页
            path: '/home/goodsList',
            component: GoodsList
        },
         {//商品简介页
            path: '/home/goodsInfo/:id',
            name:'goodsInfo',
            component: GoodsInfo
        },
         {//商品详情页
            path: '/home/goodsDesc/:id',
            name:'goodsDesc',
            component: GoodsDesc
        },

        {//商品评论页
            path: '/home/goodsComment/:id',
            name:'goodsComment',
            component: GoodsComment
        },

        {
            path: '/vip',
            component: Vip
        },
        {
            path: '/search',
            component: Search
        },
        {
            path: '/shopCar',
            component: ShopCar
        },

    ],
    linkActiveClass: 'mui-active'//覆盖默认的路由高亮的累,默认的类是router-link-active

})
